package com.leyu.mall.admin.cms.service.impl;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.leyu.mall.admin.cms.dao.CmsADLinkMapper;
import com.leyu.mall.admin.cms.domain.CmsADLink;
import com.leyu.mall.admin.cms.service.ICmsADLinkService;
import com.leyu.mall.common.facade.ICmsADLinkFacade;

@Service
@Transactional(rollbackFor=Exception.class)
public class CmsADLinkServiceImpl implements ICmsADLinkService,ICmsADLinkFacade{
	
	@Resource(name="cmsADLinkMapper")
	private CmsADLinkMapper cmsADLinkMapper;
	

	public CmsADLink getCmsADLinkById(Long entity_id)  throws Exception{
		return cmsADLinkMapper.getCmsADLinkById(entity_id);
	}

	public void save(CmsADLink entity) throws Exception{
		if(entity.getAdlinkId()== null){
			cmsADLinkMapper.addCmsADLink(entity);
			
		}
		else{
		
			cmsADLinkMapper.updateCmsADLink(entity);
		}
 
	}
	public void deleteCmsADLink(Long  id)throws Exception{
		cmsADLinkMapper.deleteCmsADLink(id);
	}
	public List<CmsADLink> getAllCmsADLink()throws Exception{
		 
 
		return cmsADLinkMapper.getAllCmsADLink();
		
	}
}